package cn.tedu.store.commons.pojo.product.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 属性
 *
 * @author RelentlessFlow
 * @version 0.0.1
 */
@Data
public class AttributeAddNewDTO implements Serializable {

    @ApiModelProperty(value = "模板Id", required = true, example = "2")
    @NotNull(message = "必须模板Id")
    private Long templateId;

    @ApiModelProperty(value = "属性名称", required = true, example = "销售")
    @NotNull(message = "必须填写名称")
    private String name;

    @ApiModelProperty(value = "属性简介", required = true, example = "销售属性的简介")
    @NotNull(message = "必须填写属性简介")
    private String description;

    @ApiModelProperty(value = "属性类型", required = true, example = "1")
    @NotNull(message = "必须填写类型")
    private Integer type;

    @ApiModelProperty(value = "输入类型", required = true, example = "2")
    @NotNull(message = "必须输入类型")
    private Integer inputType;

    @ApiModelProperty(value = "备选值列表", required = true, example = "无")
    @NotNull(message = "必须输入备选值列表")
    private String valueList;

    @ApiModelProperty(value = "计量单位", required = true, example = "件")
    @NotNull(message = "必须填写计量单位")
    private String unit;

    @ApiModelProperty(value = "自定义排序序号", required = true, example = "99")
    @NotNull(message = "必须填写排序序号")
    @Range(min = 1,max = 255,message = "必须在[1,255]区间内")
    private Integer sort;

    @ApiModelProperty(value = "是否允许自定义", required = true, example = "1")
    @NotNull(message = "必须填写是否允许自定义")
    @Range(min = 0,max = 1,message = "必须是0或1")
    private Integer isAllowCustomize;
}

